# 向 127.0.0.1：8000/books/delete_book/{book_title}发送delet请求，删除books内容
import requests  # 添加requests库导入

def delete_book():
    book_title = input("Enter book title: ")  # 输入要删除的书籍标题
    # 修正请求的URL为删除接口，并且将book_title作为路径参数拼接在URL中
    response = requests.delete(f"http://127.0.0.1:8000/books/delete_book/{book_title}")
    print(response.json())

if __name__ == "__main__":  # 确保只有在直接运行该脚本时才执行delete_book()函数
    delete_book()